<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 对象的属性名的简洁表达方式
        let name = "jack";
        let age = 20;
        let height = 175;

        let obj ={
            name:name,
            age:age,
            height:height
        }

        let obj1={
            name,age,height,weight:100
        }

        console.log(obj,obj1);

        // 回顾一下对象的解构赋值
        let {a,b,c} = {a:1,b:2,c:3};

        let {a:a,b:b,c:c} = {a:1,b:2,c:3};

        //  ES6 对对象方法的简写
        let obj3={
            sayHello: function(){
                console.log("hello");
            },

            test:() =>{
                console.log("test");
            }
        }

        let obj4 = {
            sayHello(){
                console.log("hello");
            },

            test(){
                console.log("test");
            }
        }

        function fn(){
            console.log("fn");
        }
        let obj5 = {
            // fn:fn
            fn
        }


        




    </script>
</body>
</html>